package lib.bone.flow.dao;

import lib.bone.flow.domain.entity.FlowTaskAssign;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface FlowTaskAssignDAO extends JpaRepository<FlowTaskAssign,String> {


    /**
     * 根据 DefineCode 和 NodeId 进行查询
     */
    List<FlowTaskAssign> findByFlowDefineCodeAndFlowNodeId(String flowDefineCode,String flowNodeId);

    Optional<FlowTaskAssign>  findByAssignId(String assignId);


    /**
     * 重复性校验
     */
    Boolean existsByFlowDefineCodeAndFlowNodeIdAndAssignTypeAndAssignId(String flowDefineCode,String flowNodeId,String assignType,String assignId);
}
